<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style>

    </style>
</head>

<body>
    <div id="app">
        <!-- 注意:在遍历对象身上的键值对的时候;除了有 val key ,在第三个位置还有一个索引 -->
        <p v-for="(val, key , i) in user">值:{{val}}---键:{{key}}---索引:{{i}}</p>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data: {
                user:{
                    id: 1,
                    name: 'tony',
                    gender: '男'
                }
            },
            methods: {

            }
        })
    </script>
</body>

</html>